package org.cuatrovientos.facture;

/**
 * Makes factures and adds iva.
 * @author  Bajeril
 *
 */
public class Facture {
	private static final double iva = 0.21d;
	private static final double reduced_iva = 0.04d;
	private static final double discount = 0.10d;
	private double total;
	private double subtotal;
	
	public Facture (double totalFacture) {
		subtotal = totalFacture;
	}
	
	/**
	 * Add the iva to the total price
	 */
	public void Add_iva () {
		total = subtotal + (subtotal * iva);
	}

	/**
	 *  Adds the reduced iva to the total price
	 */
	public void Add_reducedIva () {
		total = subtotal + (subtotal * reduced_iva);		
	}
	
	/**
	 * Makes a reduced discount
	 */
	public void Reduce_Discount () {
		total = subtotal - (subtotal * discount);
	}

	/**
	 * @return the total
	 */
	public double getTotal() {
		return total;
	}

	/**
	 * @param total the total to set
	 */
	public void setTotal(double total) {
		this.total = total;
	}

	/**
	 * @return the subtotal
	 */
	public double getSubtotal() {
		return subtotal;
	}

	/**
	 * @param subtotal the subtotal to set
	 */
	public void setSubtotal(double subtotal) {
		this.subtotal = subtotal;
	}
	

}
